package facilius.controller.action.curso;

import facilius.model.ServiceLocator;
import facilius.model.pojo.Curso;
import org.mentawai.core.BaseAction;

/**
 *
 * @author Graciano
 */
public class CursoUpdateAction extends BaseAction{

    @Override
    public String execute() throws Exception {
        String consequence = ERROR;
        try {
            Curso curso = new Curso();
            curso.setId(input.getLong("id"));
            curso.setDescricao(input.getString("descricao"));
            ServiceLocator.getCursoService().update(curso);
            consequence = SUCCESS;
        } catch (Exception e) {
            consequence = "EXCEPTION";
            e.printStackTrace();
        }
        return consequence;
    }

}
